/**
 * 
 */
package sopia.sg;

import java.util.Calendar;

import sopia.conn.DBAdapter;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.Spinner;
import android.widget.TextView;

/**
 * @author tatsu@gmail.com
 *
 */
public class G001Activity extends Activity {

	/**
	 * 
	 */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.g001_layout);
		init();		
		
	}

	private void init() {
		TextView main = (TextView) findViewById(R.id.main);
		   final Calendar cl = Calendar.getInstance();
		   int year = cl.get(Calendar.YEAR);
		   int month = cl.get(Calendar.MONTH);
		   int day = cl.get(Calendar.DAY_OF_MONTH);
		   String today =String.valueOf(day) + "/" + String.valueOf(month + 1) + "/" + String.valueOf(year);
		   String mybudget = getString(R.string.mybudget);
		   
		   main.setText(mybudget +  " - Today " + today);
		//init spinner
		Spinner unitSpinner = (Spinner) findViewById(R.id.typeAccount_main);
		ArrayAdapter adapter = ArrayAdapter.createFromResource(
		            this, R.array.account, android.R.layout.simple_spinner_item);
	    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
	    unitSpinner.setAdapter(adapter);
		//
		final ImageButton forwardSettingImageButton = (ImageButton) findViewById(R.id.forward_setting_imageButton);
		forwardSettingImageButton.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent i = new Intent(G001Activity.this, G002Activity.class);
				i.putExtra("ID", "G001");
				startActivity(i);

			
				finish();
			}
		});
		// button search
//		final Button search = (Button) findViewById(R.id.button_search);
//		search.setOnClickListener(new OnClickListener() {
//			
//			@Override
//			public void onClick(View v) {
//				Intent i = new Intent(G001Activity.this, ListItem.class);
//				i.putExtra("ID", "G001");
//				startActivity(i);
//				finish();
//			}
//		});
	}
	
	

}
